package com.qq4j.openapi.oauth2;import java.util.logging.Level;import java.util.logging.Logger;import org.apache.commons.lang3.StringUtils;import org.scribe.extractors.AccessTokenExtractor;import org.scribe.model.Token;/** * @author Hover Ruan */public class QQ2AccessTokenExtractor implements AccessTokenExtractor {	private static final Logger log = Logger			.getLogger("qqclient2/access_token_extractor");	public Token extract(String response) {		System.out.println(response);		try {			QQ2AccessTokenResponse tokenResponse = new QQ2AccessTokenResponse();			String[] strs = StringUtils.split(response, "&");			tokenResponse.setAccessToken(strs[0].split("=")[1]);			tokenResponse.setExpiresIn(Long.parseLong(strs[1].split("=")[1]));			return new QQ2AccessToken(tokenResponse);		} catch (Exception e) {			log.log(Level.WARNING, "Failed to parse access token response: "					+ e.getMessage(), e);			return null;		}	}}